package com.application.fabric.test.pathchangetest;

import com.application.fabric.fabriccontrol.config.Accountpath;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.io.File;

@Repository
public class changepath{
    @Autowired
    private  Accountpath accountpath;
   public void changemain(){
       changemain(accountpath.getOrderk1());
       changemain(accountpath.getOrderk2());
       changemain(accountpath.getOrderk3());
       changemain(accountpath.getPeerk1());
       changemain(accountpath.getPeerk2());
       changemain(accountpath.getPeerk3());
       changemain(accountpath.getPeerk4());
       /*org2*/
       changemain(accountpath.getPeerk5());
       changemain(accountpath.getPeerk6());
       changemain(accountpath.getPeerk7());
       changemain(accountpath.getPeerk8());
   }


    private static void changemain(String str){
        File directory = new File(str);
        File[] fileList = directory.listFiles();
        for (File file : fileList) {
//            String fileName = file.getName();
            String newFileName = "pri_sk";
            file.renameTo(new File(directory, newFileName));
        }
    }
}
